Skip to content

Conversation

Sisu860
Copy link

@Sisu860 Sisu860 commented Jul 20, 2025

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist
✅ Completed Work Summary
This batch includes object destructuring practice, filtering arrays with conditions, and formatting console output for clear receipt printing.

🏠 Array Filtering & Object Destructuring

Implemented a function to filter and print names of Gryffindor students using object destructuring.

Added a function to identify and print teachers who have pets by destructuring object properties and applying multiple conditions.

📄 Formatted Receipt Output

Created a receipt printer that logs each item’s quantity, name, and total price using destructuring.

Used string padding and number formatting to align output neatly in columns.

Calculated and printed the grand total of the order with two decimal precision.

🔍 Best Practices & Code Clarity

Ensured function calls to trigger execution after declaration.

Applied concise and clear variable unpacking for better readability.

Emphasized the importance of formatting for human-friendly console logs.

🧪 Testing & Validation

Manually tested all functions against provided sample data arrays.

Confirmed outputs match expected results exactly, including formatting.

Questions
None at the moment.

…hers-with-pets filter, and formatted takeout receipt using object destructuring
@Sisu860 Sisu860 added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Data Flows labels Jul 20, 2025
@LonMcGregor LonMcGregor added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jul 28, 2025
Copy link

@LonMcGregor LonMcGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work in this task - I've left a couple of comments where improvements could be made

@@ -70,3 +70,22 @@ let hogwarts = [
occupation: "Teacher",
},
];
function getGryffindorStudents(hogwarts) {
for (const { firstName, lastName, house } of hogwarts) {
if (house === "Gryffindor") {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to be consistent with indentation. Here your for block is missing indentation.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, thank you.

@@ -70,3 +70,22 @@ let hogwarts = [
occupation: "Teacher",
},
];
function getGryffindorStudents(hogwarts) {
for (const { firstName, lastName, house } of hogwarts) {
if (house === "Gryffindor") {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function is called getGryffindorStudents - you are correctly filtering on house here, is there anything else to filter?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added another filter.

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jul 28, 2025
@Sisu860 Sisu860 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 28, 2025
@LonMcGregor
Copy link

great work - you are done with this sprint. you can close this now

@LonMcGregor LonMcGregor added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 29, 2025
Copy link

Your PR's title isn't in the expected format.

Please check its title is in the correct format, and update it.

Reason: Sprint part (Module-Data-Flows) doesn't match expected format (example: 'Sprint 2', without quotes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complete Volunteer to add when work is complete and all review comments have been addressed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants